#pragma once
#include"Hash_Bucket.h"

template<class K,class Hash=HashFun<K>>
class UnorderedSet
{
	struct keyOfSet
	{
		const K& operator()(const K& key)
		{
			return key;
		}
	};
public:
	typedef typename Hash_Bucket<K, const K, keyOfSet, Hash>::Iterator iterator;
	typedef typename Hash_Bucket<K, const K, keyOfSet, Hash>::ConstIterator const_iterator;

	iterator begin()
	{
		return _ht.Begin();
	}

	iterator end()
	{
		return _ht.End();
	}

	const_iterator begin() const
	{
		return _ht.Begin();
	}

	const_iterator end() const
	{
		return _ht.End();
	}

	pair<iterator, bool> insert(const K& key)
	{
		return _ht.Insert(key);
	}

	iterator find(const K& key)
	{
		return _ht.Find(key);
	}

	bool erase(const K& key)
	{
		return _ht.Erase(key);
	}

private:
	Hash_Bucket<K, const K, keyOfSet, Hash> _ht;
};